package practice.library.gremlin_scala.api

import com.thinkaurelius.titan.core.TitanGraph
import practice.library.gremlin_scala.example.ConsoleExample
import shapeless.HNil
import utility.CustomLogger

/**
  * Created by lovepocky on 16/6/30.
  */
object TestAPI extends CustomLogger {

	import gremlin.scala.GremlinScala
	import gremlin.scala._
	import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__
	import practice.library.gremlin_scala.utility.CustomGremlinUtility._
	import com.thinkaurelius.titan.core.TitanTransaction

	object Transform {

	}

	def getVertexWithAddition(g: ScalaGraph[TitanGraph], traversals: => GremlinScala[_, HNil], vertexId: Any*): Any = {
		loggers.console.debug(s"getVertexWithAdditional: vertexId -> ${vertexId}")
		val vertex = g.V(vertexId)
		loggers.console.debug(vertex.valueMap().toList().toString)

	}

	def getSingleVertexWithAddition(g: ScalaGraph[TitanGraph], vertexId: Any) = {
		loggers.console.debug(s"getSingleVertexWithAddition: vertexId -> ${vertexId}")
		val vertex = g.V(vertexId).head()
		loggers.console.debug((vertex.label(), vertex.valueMap()).toString())
		vertex.label() match {
			case "city" =>
				vertex.in("location").group().by(__.label())
			case _ =>
		}
		g.V.`match`(__.has(""))
	}


	def test() = {
		val g = ConsoleExample.graphOfCassandraWith160()

	}

}
